package com.richapp.launcher.utils;

import android.util.Base64;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

/**
 * Created by jack on 15/8/30.
 */
public class JackMd5 {

    private MessageDigest md5 = null;

    private String salt = "RICHAPPJACK";

    public JackMd5() {
        try {
            this.md5 = MessageDigest.getInstance("MD5");
        } catch (NoSuchAlgorithmException var2) {
            var2.printStackTrace();
        }

    }

    public String enCription(String str) {
        String result = "";
        str = str + this.salt;
        byte[] bytes = str.getBytes();
        this.md5.update(bytes);
        result = Base64.encodeToString(this.md5.digest(), Base64.NO_WRAP);
        return result;
    }

}
